drop table jms_dm.dm_tab_in_center_package_site_summary_dt;
create table if not exists jms_dm.dm_tab_in_center_package_site_summary_dt
(
    network_type            int comment '扫描网点类型2.转运中心,3.集散点',
    scan_site_code          varchar(100) comment '扫描网点编号',
    site_agent_code         varchar(100) comment '所属代理区code',
    input_site              varchar(100) comment '扫描网点名称',
    site_agent_name         varchar(100) comment '所属代理区名称',
    way_net_total           int comment '进港总发件量',
    need_way_num            int comment '应建包票数',
    in_pack_way_num         int comment '进港建包票数',
    need_no_way_num         int comment '应建未建票数',
    pack_num                int comment '进港建包数',
    first_pack_way_num      int comment '一段码包票数',
    first_pack_num          int comment '一段码包数',
    loop_in_pack_way_num    int comment '循环袋包内件票数',
    loop_pack_num           int comment '循环袋包数',
    error_pack_way_num      int comment '错建包票数',
    need_pack_direc_way_num int comment '文件类应建包票数',
    have_pack_direc_way_num int comment '文件类已建包票数',
    hav_pack_way_num        int comment '总建包票数',
    date_time               date comment '日期'
) ENGINE = OLAP DUPLICATE KEY( network_type,scan_site_code, site_agent_code)
COMMENT "进港建包统计报表汇总"
PARTITION BY RANGE(date_time)
(START ("2022-09-01") END ("2022-10-15") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(scan_site_code) BUCKETS 1
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-370",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);